#include <algorithm>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iostream>
#include <ostream>
#include <sstream>
#include <string>

#define lld long long // long long 的printf 占位符是lld
#define ENDL '\n'     // 将 endl 替换为 \n 取消缓冲区

const long long MAX_ = 1e9;

using std::cin;
using std::cout;
using std::string;
int a[10909];
void solve() {
  memset(a, 0, sizeof(a));
  int n;
  cin >> n;

  int x;
  int L = 0, R = 0;
  for (int i = 0; i < n; ++i)
    cin >> a[i];
  bool tag = 0;
  for (int i = 0; i < n; ++i) {
    if (a[i] - 1 <= R) {
      R += a[i];
    } else {
      // cout << "NOT";
      cout << R + 1 << ENDL;
      return;
    }
  }
  cout << R + 1 << ENDL;
}
int main() {
  int T = 1;
  cin >> T;
  while (T--) {
    solve();
  }
}